1. Field of the Invention
The present invention relates to a method and apparatus for rendering three-dimensional (3D) graphics data and a computer-readable recording medium having recorded thereon a program for implementing the method.
2. Description of the Related Art
As examples of 3D graphics data used in outputting devices for the 3D graphics data, there are standard file formats such as virtual reality modeling language (VRML) and moving picture expert group (MPEG) and file formats defined by general-purpose programs. The 3D graphics data includes geometrical information of an object in a 3D space, e.g., positions of 3D vertexes constituting the object and connection information of the 3D vertexes, material information of the object, e.g., the texture, transparency, and color of the object, the reflectivity of the surface of the object, and the position and characteristic of a light source, and change information of the geometrical information and the material information over time.
To read such 3D graphics data and output the same to a screen, an apparatus for parsing meaning from the read 3D graphics data and performing data transformation is required. Such an apparatus is usually called a 3D graphics rendering engine. The 3D graphics rendering engine includes a parser and a renderer. The parser reads 3D graphics data and parses meaning from the read 3D graphics data. In other words, the parser determines whether the read 3D graphics data is geometrical information of an object, material information of an object, or information about subordination between objects caused by a scene graph structure and parses meaning from the 3D graphics data.
The renderer renders a scene graph parsed by the parser and outputs the rendered scene graph.
However, such a conventional rendering engine is configured with one rendering function that includes all codes capable of processing 3D data. In other words, a conventional rendering engine performs rendering using only a single software code without considering the characteristic of 3D data to be rendered. Since the rendering function includes a large number of unnecessary codes that will not to be executed as well as codes that are to be executed according to the characteristic of 3D data to be rendered, its size is unnecessarily large. As the size of the rendering function increases, the rendering function cannot be loaded into a cache, resulting in an unnecessary cache miss.
Moreover, since the rendering function includes a conditional statement or a branching statement, a pipeline of a processor may be broken, causing performance degradation.
Thus, in a conventional rendering engine using a single rendering function that includes all codes required to render 3D data, degradation in speed at which 3D graphics data is rendered is inevitable.